#include <iostream>
#include <string>
#include "../../include/lecture8/date.h"

using namespace std;

int main()
{
    string dates[] = {
        "Jan 1,2020",
        "Feb 29,2020",
        "Mar 1 2020",
        "4/1/2020",
        "March 1,   2020",
        // "Jun 32, 2020", // leak
        // "Jul 1/2020",   // format wrong
        // "3 1 2020",     // like above
    };
    try
    {
        for (auto date : dates)
        {
            Date d(date);
            cout << d << endl;
        }
    }
    catch (invalid_argument &e)
    {
        cout << e.what() << endl;
    }
}